<?php

namespace SisesporteAdmin\Form;

use Zend\Form\Form,
    \Zend\Form\Element\Select,
    \Zend\Form\Element\File;

// use SisesporteAdmin\Filter\ServidorFilter;

class CadastrarAfastamentoForm extends Form {

    protected $em;

    public function __construct($name = NULL, $em = NULL) {
        parent::__construct('servidor');
        $this->em  = $em;

        $this->setAttribute('method', 'post');
//         $this->setInputFilter(new ServidorFilter());

        $this->add(array(
           'name' => 'dtInicio',
            'options' => array(
                'type' => 'text',
                'label' => 'Data de Inicio:'
            ),
            'attributes' => array(
                'id' => 'dtInicio',
                'class' => 'input-medium data form-txt'

            )
        ));

         $this->add(array(
           'name' => 'dtFinal',
            'options' => array(
                'type' => 'text',
                'label' => 'Data de fim:'
            ),
            'attributes' => array(
                'id' => 'dtFinal',
                'class' => 'input-medium'
            )
        ));

        $this->add(array(
                 'name' => 'txJustificativa',
                 'type' => 'Textarea',
                  'options' => array(
                         'label' => 'Justificativa:',

                 ),
                 'attributes' => array(
                         'id' => 'txJustificativa',
                         'rows'=>'6',
                         'cols'=>'10',
                         'style'=>'width: 88%; height: 20%'
                         )
         ));

          $this->add(array(
           'name' => 'cadastar',
            'type' => 'Zend\Form\Element\Submit',
            'attributes' => array(
                'value' => 'Cadastrar',
                'title' => 'Cadastrar',
                'class' => 'btn btn-primary offset2'
            )
        ));

        $this->add(array(
                'name' => 'limpar',
                'type' => 'Zend\Form\Element\Submit',
                'attributes' => array(
                        'value' => 'Limpar',
                        'title' => 'Limpar',
                        'class' => 'btn btn-primary '
                )
         ));

    }

    /*
     * @return EntityManager
     */
    protected function getEm() {
        if (null === $this->em)
            $this->em = $this->getServiceLocator()->get('Doctrine\ORM\EntityManager');

        return $this->em;
    }
}